﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using FileHelpers;
namespace DataInsertAndExportLibrary
{
    public class InsertToDatabase
    {
        private string path;

        public InsertToDatabase(string path)
        {
            // TODO: Complete member initialization
            this.path = path;
        }

        public void insert()
        {
            string typeOfStock = Path.GetFileName(path).Substring(0, Path.GetFileName(path).Length - 10);
            if (typeOfStock == "hhif") 
            {
                FileHelperEngine engine = new FileHelperEngine(typeof(HsharesIndexFutures1Data));

                // To Read Use:   
                HsharesIndexFutures1Data[] res = engine.ReadFile(path) as HsharesIndexFutures1Data[];
            }
            else if (typeOfStock == "hsio") 
            {
            
            }
            else if (typeOfStock == "hsif") 
            { 
            
            } else if (typeOfStock == "dqe") 
            {
            
            }

        }
    }
}
